#include "stdafx.h"

FlashAnimation::FlashAnimation(int x, int y) :AbstractAnimation()
{
	this->x = x;
	this->y = y;
}

FlashAnimation::~FlashAnimation()
{
}

void FlashAnimation::setImage(const std::string & filename)
{
	img = ImageMgr::getInstance()->get(filename);
}

void FlashAnimation::setLasting(double lasting)
{
	this->lasting = lasting;
}

void FlashAnimation::setMap(Map * map)
{
	this->map = map;
}

bool FlashAnimation::update(double dtime)
{
	time += dtime;

	if (time > lasting)
	{
		return false;
	}
	else
	{
		return true;
	}
}

bool FlashAnimation::render()
{
	return img->render(getDisplayX(), getDisplayY(), angle);
}